<?php
/**
 * tvb log appender
 *
 * this file get appender factory
 * 
 * @author William Hu <william.hu@achievo.com>
 * @version 1.0
 * @package TVBLog
 */
class TVB_Logger_Appender
{
    /**
     * Log a message to this appender.
     *
     * @param  string $type
     * @return object
     */
    public static function get($type, $libpath=CLASS_PATH)
	{
		$libpath = rtrim($libpath,'/').'/';
		require_once $libpath.$type.".php";
		$class_name = 'TVB_Logger_Appender_'.$type;
	    if (!class_exists($class_name)) {
            require_once 'TVB/Logger/Exception.php';
			throw new TVB_Logger_Exception("No exists class: ".$class_name);
        }
		$obj = new $class_name;
		return $obj;
	}
}
?>